//
//  LookupCell.h
//
//  Created by lee jory on 09-10-22.
//  Copyright 2009 Netgen. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface LookupDataGridComponentDataSource : NSObject {
	NSMutableArray *titles; //标题列表
	NSMutableArray *data; //数据体，其中包函其它列表(NSArray)
	NSMutableArray *fieldTypes; //数据类型
	NSMutableArray *columnWidth; //列宽	
}

@property(retain) NSMutableArray *titles;
@property(retain) NSMutableArray *data;
@property(retain) NSMutableArray *fieldTypes;
@property(retain) NSMutableArray *columnWidth;

@end



@interface LookupDataGridScrollView : UIScrollView{
	id lookupCell;
}
@property(assign)id lookupCell;

@end


@class EGORefreshTableHeaderView;
//数据列表组件，支持上下与左右滑动
@interface LookupCell : UIView<UIScrollViewDelegate,UIActionSheetDelegate> {
	LookupDataGridScrollView *vLeft; //左下列视图
	LookupDataGridScrollView *vRight; //右下列视图
	UIView *vRightContent; //右下列表内容
	UIView *vLeftContent; //左下列表内容
	UIView *vTopRight; //右上标题
	UIView *vTopLeft; //左上标题
	
	LookupDataGridComponentDataSource *dataSource; //列表数据源
	float contentHeight; //内容总高度
	float contentWidth; //内容总宽度
	float cellHeight; //单元格默认高度
	float cellTitleHeight; //标题行高度
	float cellWidth; //单元格默认宽度
	
	//平台对象
	int page;
	int totalPage;
	NSMutableArray *listData;
	bool isMultiSelect;
	NSMutableArray *labelBufferArray;
	NSMutableArray *valueBufferArray;
	NSMutableDictionary *aRecord;
	UIViewController *viewController;
	
	// 拖拽更新的VIEW:下页更新
	EGORefreshTableHeaderView *refreshHeaderView;
	BOOL _reloading;
	
	// 拖拽更新的VIEW：上页更新
	EGORefreshTableHeaderView *refreshHeaderView_Up;
	BOOL _reloading_up;
    
    int actionSheetFlag;
}

@property (readonly) LookupDataGridScrollView *vRight;
@property (readonly) LookupDataGridScrollView *vLeft;
@property (readonly) float cellHeight;
@property (retain) 	LookupDataGridComponentDataSource *dataSource;
@property (nonatomic, retain) NSMutableArray *listData;
@property (nonatomic) bool isMultiSelect;
@property (nonatomic, retain) NSMutableArray *labelBufferArray;
@property (nonatomic, retain) NSMutableArray *valueBufferArray;
@property (nonatomic, retain) NSMutableDictionary *aRecord;
@property (nonatomic, assign)UIViewController*  viewController;

//用指定显示区域 与 数据源初始化对象
- (id)initWithFrame:(CGRect)aRect 
			   data:(LookupDataGridComponentDataSource*)aDataSource 
   valueBufferArray:(NSMutableArray *)valueArray
   labelBufferArray:(NSMutableArray *)labelArray 
		   listData:(NSMutableArray *)datas 
	  isMultiSelect:(bool) multiSelect 
			 record:(NSMutableDictionary *)record 
		  totalPage:(int)totalPg 
		currentPage:(int)curPage;

-(void)layoutSubView:(CGRect)aRect;
-(void)addRightArrow:(UIView*)view;
@end
